import rxAjax from '@/assets/js/ajax.js';


//数据源定义管理 api接口
const FormPopularCityApi = {};

FormPopularCityApi.baseUrl= '/api-form/form/core/formPopularCity';
FormPopularCityApi.exportUrl= FormPopularCityApi.baseUrl + '/listExport';

//获取某个分类和页签下的城市数据
FormPopularCityApi.getByCategoryAndCode =function(categoryId,code) {
    var url= FormPopularCityApi.baseUrl + '/getByCategoryAndCode?categoryId=' + categoryId + '&code=' + code;
    return rxAjax.get(url);
}

//保存城市分类树
FormPopularCityApi.save =function(parameter) {
    var url= FormPopularCityApi.baseUrl + '/save';
    return rxAjax.postJson(url,parameter);
}


//根据id删除城市分类
FormPopularCityApi.delByIds =function(parameter) {
    var url = FormPopularCityApi.baseUrl + '/delById';
    return rxAjax.postUrl(url,parameter);
}

FormPopularCityApi.getPopularCityOrderBySn=function(){
    var url=FormPopularCityApi.baseUrl + '/getPopularCityOrderBySn';
    return rxAjax.get(url);
}

//查询热门城市分类
FormPopularCityApi.query =function(parameter) {
    var param = {
        params:parameter,
        sortField:"SN_",
        sortOrder:"asc"
    }
    var url= FormPopularCityApi.baseUrl + '/query';
    return rxAjax.postJson(url,param);
}

export  default FormPopularCityApi;

